home *** CD-ROM | disk | FTP | other *** search
- Path: news1.h1.usa.pipeline.com!usenet
- From: grantp@usa.pipeline.com(Pete)
- Newsgroups: comp.lang.c++
- Subject: Re: Open database.mdb file, HOW ?
- Date: 1 Feb 1996 11:53:23 GMT
- Organization: Kalevi, Inc.
- Message-ID: <4eq9jj$7eh@news1.usa.pipeline.com>
- References: <310FC242.6128@geis.geis.com>
- NNTP-Posting-Host: pipe5.h1.usa.pipeline.com
- X-PipeUser: grantp
- X-PipeHub: usa.pipeline.com
- X-PipeGCOS: (Pete)
- X-Newsreader: Pipeline USA v3.3.0
-
- On Jan 31, 1996 14:25:54 in article <Re: Open database.mdb file, HOW ?>,
- 'westley <westley@geis.geis.com>' wrote:
-
-
- >Peter Bohn wrote:
- >>
- >> Hello !!!
- >>
- >> How can I open a *.mdb file with C++-coding. Sitting here with
- >> MS Vc++ 4.0, and I really don't know how. So please get me started with
- >> some lines.
- >> Peter
- >
- >Your first step is to find out the document structure of an mdb
- >file. Some structurs are published in tech manuals IE. Ihave a
- >programming book call Advance C which has the structure for
- >DBASE. Once you know the structure it simple to write code
- >to read one in.
- >
- Correct, except for one minor glitch: The format of Microsoft
- Access (.mdb) files is a closely guarded secret. An ordinary
- mortal can't get his/her hands on it.
-
- The simple answer is to use ODBC. One way to do
- this with the original poster's development system is to:
-
- 1. Start a project with the Wizard, choosing database
- support mode "Header files only".
-
- 2. Use the Class Wizard to add a new class inheriting
- from the CRecordset class.
-
- 3. Follow the Wizard's instructions and use online docs
- to accomplish what one wants to do.
-
- Note that the Class Wizard will automatically connect to
- the database and get the column names for you. You
- can then decide which columns to bind. Easy as pie!
-
- Note. If you already have a project and didn't choose
- the option in 1. above, just go to the file stdafx.h and
- add the line "#include <afxdb.h> after all the other includes.
-
- Note. You can use DAO instead of ODBC. Almost the
- same, just the names have been changed to protect....
-
- --
- Pete Grant
- Kalevi, Inc.
- Object Oriented Software Development
-